
package com.amado.springboot.springbootcms.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

import com.amado.springboot.springbootcms.interceptor.LoginInterceptor;

/**
 * @author wangyl-910
 * @description
 * @date 2018/3/2
 * @see
 */
@Configuration
public class WebConfig extends WebMvcConfigurerAdapter {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new LoginInterceptor()).addPathPatterns("/**/*").excludePathPatterns("/")
                .excludePathPatterns("/user/login").excludePathPatterns("/swagger-resources/**").excludePathPatterns("/error");
        super.addInterceptors(registry);
    }
}
